<!-- 侧边栏选择器创建 -->
<template>
    <div>
        <el-cascader :options="options" v-model="selectedOptions" @change="handleChange" placeholder="请选择地区">
        </el-cascader>
    </div>
</template>
  
<script>
import { regionData, CodeToText } from 'element-china-area-data'

export default {
    name: "cascader",
    data() {
        return {
            options: regionData,
            selectedOptions: []
        }
    },
    methods: {
        handleChange(val) {
            // 将区域码转换成汉字
            console.log(CodeToText[val[0]])
            console.log(CodeToText[val[1]])
            console.log(CodeToText[val[2]])
        }
    }
}
</script>
<style>
.el-cascader {
    width: 300px;
}
</style>
